package com.ruoyi.market.constant;

import cn.hutool.core.util.RandomUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.SecureUtil;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 系统常量
 */
public class SystemConstant {

    /**
     * 渠道推广链接 格式化 规则
     */
    public static final String CHANNEL_EXT_URL_FORMAT = "{}/exp/chl/{}";

    public static final String AES_KEY = "HSLX5U407553ZCZ7";

    public static List<Map<String, Object>> mapList = new ArrayList<>();
    static {

        /**
         * 根据 user-agent 查询的浏览器名称
         */
        Map<String, Object> weiMap = new HashMap<>();
        weiMap.put("name", "微信");
        weiMap.put("value", "MicroMessenger");

        Map<String, Object> qqMap = new HashMap<>();
        qqMap.put("name", "QQ");
        qqMap.put("value", "QQBrowser");

        mapList.add(weiMap);
        mapList.add(qqMap);

    }


    public static void main(String[] args) {

//        System.out.println(RandomUtil.randomString(32).toUpperCase());

        String content = "RDtJe171qETxNYuXS770MVgfMQ76a6";

        String encrpty = SecureUtil.aes(StrUtil.bytes(AES_KEY)).encryptBase64(content);

        System.out.println(encrpty);

        String result = SecureUtil.aes(StrUtil.bytes(AES_KEY)).decryptStr(encrpty);

        System.out.println(result);

    }


}
